<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <form method="post" class="form-horizontal " id="myform"  action="{:U('Admin/AdminUser/resetPwdPost')}">                
         <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*当前密码</label>
            <div class="span3" ><input type="password" style="width: 556px;" name="old_pwd"  id="old_pwd"></div>
        </div>
        
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*新密码</label>
            <div class="span3" ><input type="password" style="width: 556px;" name="new_pwd"  id="new_pwd"></div>
        </div>
        
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*确定新密码</label>
            <div class="span3" ><input type="password" style="width: 556px;" name="new_pwd_again" id="new_pwd_again" ></div>
        </div>

        
        <div class="form-actions" style="padding-left:260px;">
        <input type="hidden" name="admin_id" id="admin_id" value="<?php echo $admin_id;?>">
            <a class="btn btn-primary" id="ajaxform">提 交</a>
            &nbsp;&nbsp;<a class="btn" id="ajaxback">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript"
        src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
$(function(){
    $("#ajaxform").click(function(){    // 提交按钮触发事件
        var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址
        var admin_id = $("#admin_id").val();
        var old_pwd = $("#old_pwd").val();
        var new_pwd = $("#new_pwd").val();
        var new_pwd_again = $("#new_pwd_again").val();

        $.post(tourl,{
        	admin_id:admin_id,
        	old_pwd:old_pwd,
        	new_pwd:new_pwd,
        	new_pwd_again:new_pwd_again},function(result){
        		
        	if(result == '1'){
        		var msg = '编辑成功';
        		parent.layer.msg(msg,{time:2000},1,function(a){
            		
        		});
        		setTimeout(function(){
        			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        			parent.layer.close(index);
        		}, 1000);
        	}else{
        		var msg = result['info'];
        		parent.layer.msg(msg,{time:2000},1,function(a){
        		});
        	}
        	
    		
          });
    });
    $("#ajaxback").click(function(){
    	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
		parent.layer.close(index);
    });
});
</script>
</body>
</html>